import type { FormSchema } from '@/components/core/schema-form/';

export const useFlowSortSchema = (): FormSchema<API.AddFlowSortParams>[] => [
  {
    field: 'sortName',
    component: 'Input',
    label: '类型名称',
    rules: [{ required: true, type: 'string' }],
  },
  {
    field: 'sortParentId',
    component: 'TreeSelect',
    label: '所属上级',
    componentProps: {
      fieldNames: {
        label: 'sortName',
        value: 'sortId',
      },
      getPopupContainer: () => document.body,
    },
    rules: [{ required: false, type: 'number' }],
  },
];
